<template>
  <div class="maincontent synSpv">
    <el-form :inline="true" :model="form" label-width="80px">
      <el-form-item label="开始时间">
        <el-date-picker v-model="form.startTime"></el-date-picker>
      </el-form-item>
      <el-form-item label="截止时间">
        <el-date-picker v-model="form.endTime"></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary">查询</el-button>
      </el-form-item>
    </el-form>
    <div class="lines"></div>
    <el-table :data="tableData" tooltip-effect="dark">
      <el-table-column type="index" label="序号" width="55" align="center"></el-table-column>
      <el-table-column prop="companyName" label="测绘单位" align="center"></el-table-column>
      <!--el-table-column prop="mapPerson" label="测绘人员" align="center"></el-table-column-->
      <el-table-column prop="time" label="测绘时间" align="center"></el-table-column>
      <el-table-column prop="place" label="测绘地点" align="center"></el-table-column>
      <!--el-table-column label="操作" align="center" >
        <template slot-scope="scope" >
          <span class="viewDetail" @click="$router.push({name: `viewDetail`, params: {supervice: scope.row}})">查看</span>
        </template>
      </el-table-column-->
    </el-table>
    <div class="text-right">
      <el-pagination
        :current-page.sync="currentPage"
        :page-size="pageSize"
        layout="prev, pager, next, jumper"
        :total="total"
        :disabled="!total"
        style="margin-top:20px"
      ></el-pagination>
    </div>
    <div class="detailContainer">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
import { getSuperviceList } from "@/api/earlyMapping/countryAuditAdvice";
export default {
  data() {
    return {
      form: {
        startTime: "",
        endTime: ""
      },
      projectId: 1,
      tableData: [],
      currentPage: 1,
      pageSize: 1,
      total: 0
    };
  },
  created() {
    this._getSuperviseList();
  },
  methods: {
    onSubmit() {},
    _getSuperviseList() {
      getSuperviceList({
        page: this.currentPage,
        size: this.pageSize,
        projectId: this.projectId,
        startTime: this.form.startTime,
        stopTime: this.form.endTime
      }).then(res => {
        this.total = res.data.total;
        this.tableData = res.data.rows;
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.synSpv {
  /deep/ .el-form-item__content,
  /deep/ .el-input {
    width: 130px;
    height: 36px;
  }
  input {
    width: 130px;
    height: 36px;
    line-height: 36px;
  }
  /deep/ .el-form-item__label {
    font-size: 14px;
    height: 36px;
    line-height: 36px;
    color: #666;
  }
}
</style>
<style lang="scss" scoped>
.maincontent {
  padding: 30px 40px;
  .lines {
    height: 10px;
    margin-top: 20px;
  }
  .viewDetail {
    cursor: pointer;
    color: #409eff;
    font-size: 14px;
  }
}
.text-right {
  text-align: right;
  margin-top: 60px;
}
</style>
